package com.ketai.dao.impl;

import com.ketai.dao.ActityTypeDao;
import com.ketai.dao.BaseDao;
import com.ketai.pojo.ActivityType;

import javax.naming.NamingException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

/**
 * @Author:长沙科泰梦想学院-蓝色小药丸
 * @Mission:打造演说·创客型跨境电商与互联网人才
 * @Description:
 * @Date:Create In 2022/8/5 15:59
 **/
public class ActityTypeDaoImpl extends BaseDao implements ActityTypeDao {
    @Override
    public List<ActivityType> getActivityTypeList () throws SQLException, NamingException {
        List<ActivityType>  items=new ArrayList<ActivityType>();
        String  sql="select * from activity_type ";
        ResultSet rs= query(sql,null);
        while (rs.next()) {
            ActivityType  type=new ActivityType();
            type.setId(rs.getInt("id"));
            type.setName(rs.getString("name"));
            items.add(type);
        }
        return items;
    }
}
